package Hander;

import View.EnrollView;
import View.PersonelView;
import entity.AdminDo;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class OptionChangeHander implements ActionListener {
    private AdminDo adminDo=new AdminDo();

    public AdminDo getAdminDo() {
        return adminDo;
    }

    public void setAdminDo(AdminDo adminDo) {
        this.adminDo = adminDo;
    }

    private EnrollView enrollView;
    public OptionChangeHander(EnrollView enrollView) {
        this.enrollView = enrollView;
    }
    @Override
    public void actionPerformed(ActionEvent e) {
        if (enrollView.option1RadioButton.isSelected()) {
            System.out.println(1);
            System.out.println(enrollView.option1RadioButton.getText());
            adminDo.setUserType(enrollView.option1RadioButton.getText());
        } else if (enrollView.option2RadioButton.isSelected()) {
            System.out.println(2);
            adminDo.setUserType(enrollView.option2RadioButton.getText());
        } else if (enrollView.option3RadioButton.isSelected()) {
            System.out.println(3);
            adminDo.setUserType(enrollView.option3RadioButton.getText());
        }
    }
}
